/**
 * 
 */
package denaris.core.controller;

import denaris.core.TiledMap;

/**
 * @author stkl23
 *
 */
public class NortheastReflectorControllerFeature extends AbstractReflectorControllerFeature{
	public void checkCollision(TiledMap map) {
		ReflectorPosition head = getHead();
		if (head == null)
			return;
		// do we have a collision ?
		if (collidesWith(map)) {
			// now determine the new direction
			int col = map.getCol(head.x);
			int row = map.getRow(head.y);
			if (map.cellAtColRow(col - 1, row) > 0) {
				getReflectorController().setCurrentFeature(new SoutheastReflectorControllerFeature());
			}else {
				getReflectorController().setCurrentFeature(new NorthwestReflectorControllerFeature());
			}
		}
	}

	public int getDeltaX() {
		return REFLECTOR_SPEED;
	}

	public int getDeltaY() {
		return -REFLECTOR_SPEED;
	}
}
